package com.zhou.yygh.cmn.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.zhou.yygh.cmn.mapper.DictMapper;
import com.zhou.yygh.cmn.service.DictService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import zhou.hospital.model.cmn.Dict;
import zhou.hospital.vo.cmn.DictEeVo;

@Component
public class DictListener extends AnalysisEventListener<DictEeVo> {
    @Autowired
     private DictService dictService;



    @Override
    public void invoke(DictEeVo data, AnalysisContext context) {
        Dict dict = new Dict();
        BeanUtils.copyProperties(data,dict);
        dictService.save(dict);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
